package com.atwisdom.star.core.bsl.planner.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class ProductBomLevel {
    //物料背番
    private String materialBCode;
    //bom层级
    private int level;
    //bom层级数量
    private double quantity;
    //父级背番
    private String parentBCode;
    //父级背番路径
    private List<String> parentBCodePath;
    //物料属性: purchasing: 采购件、produce: 制造件、outsourcing: 外协件
    private String materialAttr;
    //计划生产、采购、委外数量
    private double planQuantity = 0;
    //销售发货日期
    private LocalDate deliveryDate;
    //计划开始日期
    private LocalDate planStartDate;
    //计划结束日期
    private LocalDate planEndDate;
    //时长（小时）（生产一个产品耗时） 节拍：每分钟生产个数
    private double duration;
    //当前产品用的设备（id）列表
    private List<Integer> equipmentList;
    //生产提前期(小时)
    private Double produceLeadTime;
    //采购周期(天)
    private int purchasingPeriod;
    //委外周期(天)
    private int outsourcingPeriod;
    //耗损率
    private Double lossRate = 0.0;
    //是否副产品
    private boolean additionalFlag = false;

    //副产品列表
    private List<ProductBomSub> productBomSubList = new ArrayList<>();

    public ProductBomLevel(String materialBCode, int level, Double quantity, String parentBCode,List<String> parentBCodePath,String materialAttr,Double lossRate,List<ProductBomSub> productBomSubList  ) {
        this.materialBCode = materialBCode;
        this.level = level;
        this.quantity = quantity;
        this.parentBCode = parentBCode;
        this.parentBCodePath = parentBCodePath;
        this.materialAttr = materialAttr;
        this.lossRate = lossRate;
        this.productBomSubList = productBomSubList;
    }
}
